package top.jiangqiang.qianyi.common.auth.interceptor;

import lombok.extern.slf4j.Slf4j;
import org.jspecify.annotations.NullMarked;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import top.jiangqiang.qianyi.common.auth.service.AuthService;
import top.jiangqiang.qianyi.common.auth.service.UserDetailService;
import top.jiangqiang.qianyi.common.constants.auth.Platform;
import top.jiangqiang.qianyi.common.properties.AuthProperties;

@Component
@ConditionalOnClass(HandlerInterceptor.class)
@Slf4j
@NullMarked
public class WebsiteTokenAuthInterceptor extends TokenAuthInterceptor implements HandlerInterceptor {

    public WebsiteTokenAuthInterceptor(AuthProperties authProperties, AuthService authService, UserDetailService userDetailService) {
        super(authProperties, authService, userDetailService);
    }

    @Override
    protected Platform getSupportPlatform() {
        return Platform.WEBSITE;
    }
}